package com.gmd.model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.Set;


/**
 * The persistent class for the recetamedica database table.
 * 
 */
@Entity
@Table(name="recetamedica")
public class Recetamedica implements Serializable {
	private static final long serialVersionUID = 1L;
	private int idrecetamedica;
	private Date fechcre;
	private Historiaclinica historiaclinica;
	private Set<RecetamedicaMedicamento> recetamedicaMedicamentos;

	public Recetamedica() {
	}


	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(unique=true, nullable=false)
	public int getIdrecetamedica() {
		return this.idrecetamedica;
	}

	public void setIdrecetamedica(int idrecetamedica) {
		this.idrecetamedica = idrecetamedica;
	}


	@Temporal(TemporalType.DATE)
	public Date getFechcre() {
		return this.fechcre;
	}

	public void setFechcre(Date fechcre) {
		this.fechcre = fechcre;
	}


	//bi-directional many-to-one association to Historiaclinica
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="idhistoriaclinica", nullable=false)
	public Historiaclinica getHistoriaclinica() {
		return this.historiaclinica;
	}

	public void setHistoriaclinica(Historiaclinica historiaclinica) {
		this.historiaclinica = historiaclinica;
	}


	//bi-directional many-to-one association to RecetamedicaMedicamento
	@OneToMany(mappedBy="recetamedica")
	public Set<RecetamedicaMedicamento> getRecetamedicaMedicamentos() {
		return this.recetamedicaMedicamentos;
	}

	public void setRecetamedicaMedicamentos(Set<RecetamedicaMedicamento> recetamedicaMedicamentos) {
		this.recetamedicaMedicamentos = recetamedicaMedicamentos;
	}

}